#ifndef CAPTURETHREAD_H
#define CAPTURETHREAD_H

#include <QThread>
#include <QDebug>
#include <QCamera>
#include <QCameraImageCapture>

class CaptureThread : public QThread
{
    Q_OBJECT
public:
    CaptureThread(QCamera* camera);

public:
    // 停止线程
    void SetRun(bool flag);

protected:
    // 图像抓拍线程
    void run();

protected:
    // 现成退出标志
    bool doRun = true;
    // 图片抓拍对象
    QCameraImageCapture *cameraCapture;

signals:
    // 抓拍图片信号
    void capture(int id, QImage img);

public slots:
};

#endif // CAPTURETHREAD_H
